<?php
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Response as FacadesResponse;
use Tymon\JWTAuth\Facades\JWTAuth;
use Illuminate\Support\Facades\Session;

require_once(dirname(__file__) . "/../models/qqconnect/qqConnectAPI.php");

/**
 * 这个Controller显示主页面
 *
 * @author hongyang
 */
class LoginController extends BaseController {

	protected $layout = 'layouts.master';

	public function __construct()
	{
		parent::__construct();
	}

	public function qqLoginRedirect() {
		$qc = new QC();
		$arr = $qc->qq_login();
	}

	public function qqLoginCallback() {
		// use the code to exchange access_token$qc = new QC();
		$access_token = $qc->qq_callback();
		Log::info(__METHOD__ . __LINE__ . " " . $access_token);

		// use access_token to exchange open_id
		$open_id = $qc->get_openid();
		Log::info(__METHOD__ . __LINE__ . " " . $open_id);
	}
}
